package cn.edu.seu.cose.qol.model.dto.message;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import cn.edu.seu.cose.qol.model.dto.exception.ExceptionXmlObject;


@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "operationResult")
public class OperationResult {
	
	@XmlElement(name = "status")
	private OperationStatus _status;
	
	@XmlElement(name = "exception")
	private ExceptionXmlObject _exception;
	
	public OperationResult() {
		this(OperationStatus.SUCCESS);
	}
	
	public OperationResult(OperationStatus status) {
		this(status, null);
	}
	
	public OperationResult(OperationStatus status,
			ExceptionXmlObject exception) {
		_status = status;
		_exception = exception;
	}
	
	public void setStatus(OperationStatus status) {
		_status = status;
	}
	
	public OperationStatus getStatus() {
		return _status;
	}
	
	public void setException(ExceptionXmlObject exception) {
		_exception = exception;
	}
	
	public ExceptionXmlObject getException() {
		return _exception;
	}

}
